This application is based on application Ser. No. 11-86060 filed in Japan, the contents of which are hereby incorporated by reference.
1. Field of the Invention
The present invention relates to image processing on contrast of an image.
2. Description of Prior Art
Various kinds of image correction have been proposed on digital image data. As a contrast correction technique for an image, it is known to divide an image into rectangles and to emphasize image for each rectangle so as to optimize contrast for each rectangle of the image at a high speed.
In an example of the above-mentioned contrast correction in the unit of rectangle, an image is divided first into rectangles, and a factor of contrast enhancement is determined for each of the rectangles. The contrast enhancement factor is determined based on the pattern of histogram of image data. Image data comprises components of value, chroma and hue. For example, the contrast enhancement factor is calculated so as to expand the value histogram over the entire dynamic range. The factor is calculated for all the rectangles. Then, each pixel data in the image is converted by using the contrast enhancement factor of the rectangle including the pixel under conversion. In order to keep continuity of image data between adjacent rectangles, for example, the pixel data is converted with linear extrapolation by using contrast enhancement factors of adjacent rectangles.
However, a rectangle may include two or more sub-areas having large difference of value data between them. In such a case, in the above-mentioned contrast correction, the contrast correction may over-emphasize contrast unnecessarily, or value data may be reversed between adjacent rectangles in contrast to actual value distribution between them. Then, it is desirable to prevent such partial over-emphasis or reversal.
An object of the present invention is to provide an apparatus and a method for image correction with optimum contrast.
In one aspect of the invention, in image processing on contrast, an image is divided into rectangles, and a histogram of value data of the image is generated for each of the rectangles. It is discriminated whether the histogram generated by said histogram generator has a plurality of peaks. Then, contrast is enhanced in the unit of rectangle according to histogram. Further, when the histogram of the rectangle is discriminated to have a plurality of peaks, a rectangle is divided into sub-areas and contrast is enhanced in the rectangle in the unit of sub-area.
In another aspect of the invention, in image processing on contrast, an image is divided into rectangles, and a histogram of value data of the image is generated for each of the rectangles. It is discriminated whether the histogram generated by said histogram generator has a plurality of peaks. Then, contrast is enhanced in the unit of rectangle according to histogram. Further, when the histogram of a rectangle is discriminated to have a plurality of peaks, the contrast on the rectangle is enhanced to a degree smaller than the counterpart when the histogram of a rectangle is not discriminated to have a plurality of peaks.
An advantage of the invention is that when contrast correction is performed in an image at fast speed, partial over-emphasis of contrast and partial reversal of image data are prevented.
Another advantage of the invention is that without dividing the rectangles, partial over-emphasis of contrast and partial reversal of image data are prevented at fast speed in a simple way.